<template>
  <el-config-provider :locale="zhCn" :message="messageConfig">
    <a-config-provider :locale="locale">
      <router-view />
      <global-setting />
    </a-config-provider>
  </el-config-provider>
</template>

<script lang="ts" setup>
import { computed, ref, reactive } from "vue";
import { ElConfigProvider } from "element-plus";
import enUS from "@arco-design/web-vue/es/locale/lang/en-us";
import zhCN from "@arco-design/web-vue/es/locale/lang/zh-cn";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import enUs from "element-plus/es/locale/lang/en";
import GlobalSetting from "@/components/global-setting/index.vue";
import useLocale from "@/hooks/locale";

const { currentLocale } = useLocale();
const locale = computed(() => {
  switch (currentLocale.value) {
    case "zh-CN":
      return zhCN;
    case "en-US":
      return enUS;
    default:
      return zhCN;
  }
});
const messageConfig = reactive({
  max: 1,
});
</script>
<style lang="less">
:root {
  --el-color-primary: rgba(68, 142, 151, 1) !important;
  --el-color-primary-light-3: rgba(68, 142, 151, 1) !important;
  --el-color-primary-light-5: rgba(68, 142, 151, 0.7) !important;
  --el-color-primary-light-7: rgba(68, 142, 151, 0.5) !important;
  --el-color-primary-light-8: rgba(68, 142, 151, 0.3) !important;
  --el-color-primary-light-9: rgba(68, 142, 151, 0.1) !important;
  --el-color-primary-dark-2: rgba(68, 142, 151, 1) !important;
  --el-color-success: rgba(68, 142, 151, 1) !important;
  --el-color-success-light-3: rgba(68, 142, 151, 1) !important;
  --el-color-success-light-5: rgba(68, 142, 151, 0.7) !important;
  --el-color-success-light-7: rgba(68, 142, 151, 0.5) !important;
  --el-color-success-light-8: rgba(68, 142, 151, 0.3) !important;
  --el-color-success-light-9: rgba(68, 142, 151, 0.1) !important;
  --el-color-success-dark-2: rgba(68, 142, 151, 1) !important;
}
</style>
